package com.huangj.fragments;

import android.os.Bundle;
import android.util.Log;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.huangj.huangjlibrary.base.BaseFragment;
import com.huangj.pro2_h2pop.R;

import butterknife.BindView;

/**
 * Created by HuangJ on 2016/10/6.19:56
 */
public class TravPicSeeFragment extends BaseFragment {

    @BindView(R.id.tr_iv)
    ImageView imageView;
    public static TravPicSeeFragment getIntence(String url){
        TravPicSeeFragment travPicSeeFragment = new TravPicSeeFragment();
        Bundle bundle = new Bundle();
        bundle.putString("url",url);
        travPicSeeFragment.setArguments(bundle);
        return travPicSeeFragment;
    }

    @Override
    public int getContentId() {
        return R.layout.fragment_travelpic;
    }

    @Override
    protected void getDatas(Bundle bundle) {

        String url = bundle.getString("url");
        Log.d("print", "得到的单独图片: "+url);
        Glide.with(getActivity()).load(url).diskCacheStrategy(DiskCacheStrategy.ALL)
                .crossFade().into(imageView);
    }
}
